home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mtgrap1c / demo11.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-29  |  2.0 KB  |  84 lines

  1. /*                                                            
  2.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  3.   ▒                                                          ▒
  4.   ▒                                                          ▒
  5.   ▒             Neuromancer's Graphics Library               ▒
  6.   ▒                     Version 1.0c                         ▒
  7.   ▒                                                          ▒
  8.   ▒    This program read in a mtGraph sprite files           ▒
  9.   ▒                                                          ▒ 
  10.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  11.   ▒                                                          ▒
  12.   ▒     Project:    MTLIB01.LIB                              ▒
  13.   ▒                 DEMO11.CPP                               ▒
  14.   ▒                                                          ▒ 
  15.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  16. */
  17.  
  18. #include <iostream.h>
  19. #include <stdlib.h>
  20. #include <conio.h>
  21. #include <dos.h>
  22. #include "video.h"
  23. #include "bitmap.h"
  24. #include "palette.h"
  25.  
  26. extern SPRITE_HEADER *sprite_header;
  27.  
  28. void main(int argc, char *argv[])
  29. {
  30.     SPRITE        **sprite;
  31.     byte           palette[768];
  32.     int        width;
  33.  
  34.     if (argc!=2)
  35.     {
  36.         cout << "Usage : demo11 <filename> "<<endl;
  37.         cout << "        where filename is a mtGraph <.blt> file"<< endl;
  38.         exit(0);
  39.     }
  40.     
  41.     if ((sprite=mtLoadBlit(argv[1],palette)) == NULL)
  42.     {
  43.         cout << "Error loading :" << argv[1] << endl;
  44.         cout << "mtGraph sprite file required <.blt>"<< endl;
  45.         exit(0);
  46.     }
  47.  
  48.     mtSetVGAMode();
  49.  
  50.     mtSetPal(palette,0,255);
  51.  
  52.     width=5;
  53.  
  54.     int last = 5;
  55.  
  56.     if (last > (sprite_header->total))
  57.     {
  58.         last = sprite_header->total;
  59.     }
  60.     
  61.     for(int i = 0; i <= last; i++)
  62.     {    
  63.         mtCPutSprite(width,10,sprite[i]->width, sprite[i]->height,sprite[i]->data);
  64.         width += sprite[i]->width +5;
  65.     }
  66.  
  67.     getch();
  68.  
  69.     mtFreeBlit(sprite);
  70.     mtSetTextMode();
  71.     
  72.     cout << "Thank you for using the library!" << endl;
  73.  
  74.     exit(0);
  75.     
  76. }
  77.  
  78.            
  79.             
  80.  
  81.            
  82.  
  83.            
  84.